<template>
  <div class="school">
    <h2>学校名称：{{name}}</h2>
    <h2>学校地址：{{address}}</h2>
    <button @click="sendSchoolName">点我把name发送给App</button>
  </div>
</template>

<script>
 
export default {
     name:"School",
     props:['getSchoolName'],
     data() {
        return {
           name:'尚学堂',
           address:'赛蒂科技园'
        }
     },
     methods: {
      sendSchoolName(){
          this.getSchoolName(this.name)
      }
     },
      
}
</script>

<style scoped>
 .school{
        background-color:rgba(60, 39, 176, 0.575);
        margin: 20px 5px;
        padding: 5px;
    }
</style>